<md-button ng-if="$ctrl.node.childs && $ctrl.node.childs.length" ng-click="$ctrl.click();" ng-class="'amf-menu-item-' + $ctrl.level" class="amf-button-toggle">
	<div flex="grow" layout="row">
		<span>{{$ctrl.node.title}}</span>
		<span flex></span>
		<span ng-class="{'toggled' : $ctrl.node.isOpen}" ng-if="$ctrl.node.childs" class="amf-toggle-icon">
      <md-icon md-svg-icon="chevron-down"></md-icon>
    </span>
	</div>
</md-button>
<md-button ng-if="(!$ctrl.node.childs || !$ctrl.node.childs.length) && $ctrl.node.sref" ng-click="$ctrl.click();" ui-sref-active="md-accent active" ng-class="'amf-menu-item-' + $ctrl.level" class="amf-button-link" ui-sref="{{$ctrl.node.sref}}">
	<div flex="grow" layout="row">
		<span>{{$ctrl.node.title}}</span>
	</div>
</md-button>
<md-button ng-if="(!$ctrl.node.childs || !$ctrl.node.childs.length) && !$ctrl.node.sref" ng-click="$ctrl.click();" ng-class="'amf-menu-item-' + $ctrl.level" class="amf-button-disabled" ng-disabled="true">
	<div flex="grow" layout="row">
		<span>{{$ctrl.node.title}}</span>
	</div>
</md-button>

<md-divider></md-divider>

<div amf-slide="$ctrl.node.isOpen">
	<ul ng-if="$ctrl.node.childs.length" class="amf-menu-children">
		<li ng-repeat="child in $ctrl.node.childs">
			<amf-side-menu-item node="child" level="{{$ctrl.level + 1}}" />
		</li>
	</ul>
</div>
